package com.untour.seqid.config.leaf;

import com.untour.seqid.config.leaf.segment.SegmentIDGenImpl;
import com.untour.seqid.config.leaf.segment.service.TagsService;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@AutoConfigureAfter(LeafProperties.class)
public class LeafConfiguration {
    @Bean
    public IDGen idGen(TagsService tagsService,LeafProperties leafProperties){
        SegmentIDGenImpl segmentIDGen = new SegmentIDGenImpl(tagsService, leafProperties);
        segmentIDGen.init();
        return segmentIDGen;
    }
}
